package com.team4.muchentuchen;

import android.app.Activity;
import android.content.Intent;
import android.media.MediaPlayer;
import android.os.Bundle;

public class mySplash extends Activity {

	MediaPlayer mpSplash;
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.splash);
		mpSplash = MediaPlayer.create(this, R.raw.bottle_pop);
		mpSplash.start();	
		Thread logoTimer = new Thread(){
			public void run(){
				try{
					int timer = 0;
					while (timer<3000){
						sleep(100);
						timer+=100;
					}
					startActivity(new Intent("com.team4.muchentuchen.MYMENU"));	
				} catch (InterruptedException e) {
					e.printStackTrace();
				}
				finally{
					finish();
				}
			}
		};
		logoTimer.start();
	}
	
	
    @Override
	protected void onStart() {
		// TODO Auto-generated method stub
		super.onStart();
	}
    
    
	@Override
	protected void onStop() {
		// TODO Auto-generated method stub
		super.onStop();
	}
	/** Called when the activity is first created. */

	@Override
	protected void onDestroy() {
		// TODO Auto-generated method stub
		super.onDestroy();
		mpSplash.release();
	}

	@Override
	protected void onPause() {
		// TODO Auto-generated method stub
		super.onPause();
		mpSplash.pause();
	}

	@Override
	protected void onResume() {
		// TODO Auto-generated method stub
		super.onResume();
		mpSplash.start();
	}
    
}